package com.matrix.java.chap_07;

import com.matrix.java.util.ArrayUtil;

import java.util.Arrays;
import java.util.Scanner;

/*
    打印不同的数
 */
public class Ex7_05 {
    public static void main(String[] args) {
        int[] arrInput = new int[10];
        Scanner input = new Scanner(System.in);
        System.out.print("Enter ten numbers: ");
        for (int i = 0; i < 10; i++) {
            arrInput[i] = input.nextInt();
        }
        input.close();
        int[] arrayUnrepeated = ArrayUtil.arrayUnrepeated(arrInput);
        System.out.println("The number of distinct number is "+arrayUnrepeated.length);
        System.out.println("The distinct numbers are: "+Arrays.toString(arrayUnrepeated));
    }
}
